<%--
  Created by IntelliJ IDEA.
  User: 杨大贵
  Date: 2024/4/11
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
    <meta charset="UTF-8">
    <title>表单处理结果</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }

        .container {
            max-width: 600px;
            margin: 20px auto;
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        h2 {
            text-align: center;
            color: #333;
        }

        p {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div class="container">
    <h2>提交结果</h2>
    <%-- 获取表单提交的变量值 --%>
    <% request.setCharacterEncoding("UTF-8"); %>
    <% String username = request.getParameter("username"); %>
    <% String password = request.getParameter("password"); %>
    <% String bio = request.getParameter("bio"); %>
    <% String gender = request.getParameter("gender"); %>
    <% String subscribe = request.getParameter("subscribe"); %>
    <% String country = request.getParameter("country"); %>
    <% String[] interests = request.getParameterValues("interests"); %>

    <%-- 显示提交的变量值 --%>
    <p>用户名: <%= username %></p>
    <p>密码: <%= password %></p>
    <p>个人简介: <%= bio %></p>
    <p>性别: <%= gender %></p>
    <p>订阅此站: <%= subscribe == null ? "否" : "是" %></p>
    <p>国家: <%= country %></p>
    <p>兴趣:
        <% if(interests != null) { %>
        <% for(String interest : interests) { %>
        <%= interest %>
        <% } %>
        <% } else { %>
        无
        <% } %>
    </p>
</div>
</body>
</html>